#!/bin/bash

# 移动test和verify开头的文件到test目录的脚本

echo "开始整理项目文件..."

# 进入backend目录
cd backend

# 确保test目录存在
if [ ! -d "test" ]; then
    echo "创建test目录..."
    mkdir -p test
fi

# 移动所有test开头的文件（除了test目录本身）
echo "移动test开头的文件..."
for file in test*.py; do
    if [ -f "$file" ]; then
        echo "移动 $file 到 test/"
        mv "$file" test/
    fi
done

# 移动所有verify开头的文件
echo "移动verify开头的文件..."
for file in verify*.py; do
    if [ -f "$file" ]; then
        echo "移动 $file 到 test/"
        mv "$file" test/
    fi
done

# 移动create_test开头的文件
echo "移动create_test开头的文件..."
for file in create_test*.py; do
    if [ -f "$file" ]; then
        echo "移动 $file 到 test/"
        mv "$file" test/
    fi
done

echo "文件移动完成！"
echo "查看test目录内容："
ls -la test/

echo "\n移动的文件列表："
echo "- create_test_token.py"
echo "- create_test_user.py"
echo "- test_api_nav.py"
echo "- test_api.py"
echo "- test_asgi.py"
echo "- test_asset_allocation.py"
echo "- test_continue_download.py"
echo "- test_download_functionality.py"
echo "- test_frontend_sync.py"
echo "- test_fund_detail_download.py"
echo "- test_nav_download.py"
echo "- test_portfolio_management.py"
echo "- test_progress_api.py"
echo "- test_progress_display.py"
echo "- test_status_sync.py"
echo "- test_stop_loss.py"
echo "- test_update_nav.py"
echo "- test_websocket.py"
echo "- verify_mysql_data.py"

echo "\n文件整理完成！"